<template>
	<view class="page">
		<u-navbar :auto-back="true" :placeholder="true" title="学员详情">
			<template #right>
				<u-button customStyle="color:#333" size="small" color="#EEEEEE" shape="circle" text="退班"
					@click="handleExit"></u-button>
			</template>
		</u-navbar>
		<view class="main">
			<!-- 学员基本信息 -->
			<Card title="学员基本信息" more>
				<view class="flex align-center margin-top-sm">
					<view class="flex-1">
						<view class="text-df margin-top-xs">
							<text class="text-muted">姓名：</text>
							<text>张三（在读）</text>
						</view>
						<view class="text-df margin-top-xs">
							<text class="text-muted">性别：</text>
							<text>女</text>
						</view>
						<view class="text-df margin-top-xs">
							<text class="text-muted">联系电话：</text>
							<text>13052808068（爸爸）</text>
						</view>
					</view>
					<view>
						<u-avatar src="https://picsum.photos/200/300?random=100" mode="aspectFill" size="120rpx">
						</u-avatar>
					</view>
				</view>
			</Card>

			<!-- 学员报名情况 -->
			<Card class="margin-top" title="学员报名情况" more @clickLink="handleSignUpInfo">
				<view class="margin-top" v-for="i in 3" :key="i">
					<CollapseBox :border="true" title="周末班：一年级·数学（A）班">
						<view class="padding-tb-sm padding-lr">
							<u-text text="课程结束日期：2026-02-11" size="24rpx" color="#333"></u-text>
						</view>
					</CollapseBox>
				</view>
			</Card>

			<!-- 近期成绩单 -->
			<Card class="margin-top" title="近期成绩单" more @clickLink="handleHistoryScore">
				<view class="margin-top" v-for="i in 3" :key="i">
					<CollapseBox :border="true" title="一年级期末考试">
						<view class="padding-tb-sm padding-lr flex">
							<u-text text="语文：93" size="24rpx" color="#333"></u-text>
							<u-text text="数学：94" size="24rpx" color="#333"></u-text>
							<u-text text="英语：95" size="24rpx" color="#333"></u-text>
						</view>
					</CollapseBox>
				</view>
			</Card>

			<!-- 近期日报 -->
			<Card title="近期日报" more class="margin-top" @clickLink="handleReport">
				<view class="margin-top">
					<view class="flex gap align-center">
						<image src="/static/image/teacher/icon-student-report.png" mode="aspectFit"
							style="width: 88rpx; height: 88rpx;">
						</image>
						<view class="flex-1">
							<u-text bold text="张三的日报" size="32rpx" color="#333"></u-text>
							<u-text margin="10rpx 0 0 0" text="2025-01-01 12:00:00" size="24rpx" color="#999"></u-text>
						</view>
						<view>
							<u-icon name="arrow-right" size="28rpx" color="#999"></u-icon>
						</view>
					</view>
					<view class="margin-top-sm">
						<u-text text="今日上传100道题目，共发现10道错题" size="24rpx" color="#666"></u-text>
					</view>
				</view>
			</Card>
			<!-- 近期周报 -->
			<Card title="近期周报" more class="margin-top" @clickLink="handleWeekReport">
				<view class="margin-top">
					<view class="flex gap align-center">
						<image src="/static/image/teacher/icon-student-report.png" mode="aspectFit"
							style="width: 88rpx; height: 88rpx;">
						</image>
						<view class="flex-1">
							<u-text bold text="张三的周报" size="32rpx" color="#333"></u-text>
							<u-text margin="10rpx 0 0 0" text="2025-01-01 12:00:00" size="24rpx" color="#999"></u-text>
						</view>
						<view>
							<u-icon name="arrow-right" size="28rpx" color="#999"></u-icon>
						</view>
					</view>
					<view class="margin-top-sm">
						<u-text text="本周上传100道题目，共发现10道错题" size="24rpx" color="#666"></u-text>
					</view>
				</view>
			</Card>

			<!-- 近期错题知识点 -->
			<Card title="近期错题知识点" :more="false" class="margin-top">
				<view class="margin-top" @click="handleMistakes('语文', 1)">
					<view class="flex align-center gap-sm">
						<image src="/static/image/img-chinese.png" mode="aspectFill" style="width: 34rpx; height: 34rpx;"></image>
						<view class="flex-1">
							<text class="text-df text-gray">语文</text>
							<text class="text-df text-gray margin-left-lg">汉字拼音</text>
						</view>
					</view>
					<u-divider></u-divider>
					<view class="flex align-center gap-sm" @click="handleMistakes('数学', 2)">
						<image src="/static/image/img-math.png" mode="aspectFill" style="width: 34rpx; height: 34rpx;"></image>
						<view class="flex-1">
							<text class="text-df text-gray">数学</text>
							<text class="text-df text-gray margin-left-lg">5以内加减法</text>
						</view>
					</view>
					<u-divider></u-divider>
					<view class="flex align-center gap-sm" @click="handleMistakes('英语', 3)">
						<image src="/static/image/img-english.png" mode="aspectFill" style="width: 34rpx; height: 34rpx;"></image>
						<view class="flex-1">
							<text class="text-df text-gray">英文</text>
							<text class="text-df text-gray margin-left-lg">字母拼音</text>
						</view>
					</view>
				</view>
			</Card>

			<!-- 近期练习题 -->
			<Card title="近期练习题" more class="margin-top" @clickLink="handleExercise">
				<view class="margin-top">
					<view class="flex gap align-center">
						<image src="/static/image/teacher/icon-student-exercise.png" mode="aspectFit"
							style="width: 88rpx; height: 88rpx;">
						</image>
						<view class="flex-1">
							<u-text bold text="张三的练习题-数学" size="32rpx" color="#333"></u-text>
							<u-text margin="10rpx 0 0 0" text="2025-01-01 12:00:00" size="24rpx" color="#999"></u-text>
						</view>
						<view>
							<u-icon name="arrow-right" size="28rpx" color="#999"></u-icon>
						</view>
					</view>
					<view class="margin-top-sm">
						<u-text text="本周共发现10个错题知识点，生成30道练习题" size="24rpx" color="#666"></u-text>
					</view>
				</view>
			</Card>

			<!-- 学员考勤信息 -->
			<Card title="考勤信息" more class="margin-top" @clickLink="handleDutyInfo">
				<view class="margin-top-sm" v-for="i in 3" :key="i">
					<CollapseBox title="2025年10月20日 星期三">
						<view class="padding-tb-xs padding-lr">
							<u-text text="托管班·一年级（A）班" size="26rpx" color="#333"></u-text>
							<u-text text="签到时间 18:57:36" size="26rpx" color="#333"></u-text>
							<u-text text="签退时间 18:57:36" size="26rpx" color="#333"></u-text>
						</view>
					</CollapseBox>
				</view>
			</Card>
		</view>
	</view>
</template>

<script setup>
import CollapseBox from '@/components/CollapseBox/index.vue';
import Card from '@/components/Card/index.vue';

// 退班
const handleExit = () => {
	uni.navigateTo({
		url: '/pages/common/student/exit'
	})
}

// 学员报名情况
const handleSignUpInfo = () => {
	console.log('id')
	uni.navigateTo({
		url: '/pages/common/student/signUpInfo?id=1'
	})
}

// 过往成绩单
const handleHistoryScore = () => {
	uni.navigateTo({
		url: '/pages/common/mine/historyScore?id=1'
	})
}

// 近期日报
const handleReport = () => {
	uni.navigateTo({
		url: '/pages/common/report/index?type=daily'
	})
}

// 近期周报
const handleWeekReport = () => {
	uni.navigateTo({
		url: '/pages/common/report/index?type=week'
	})
}

// 近期错题知识点
const handleMistakes = (name, id = 1) => {
	uni.navigateTo({
		url: `/pages/common/knowledge/knowledge?name=${name}&subject=${name}&id=${id}`
	});
}

// 近期练习题
const handleExercise = () => {
	uni.navigateTo({
		url: '/pages/common/student/exercise'
	})
}

// 考勤信息
const handleDutyInfo = () => {
	uni.navigateTo({
		url: '/pages/common/student/dutyInfo'
	})
}
</script>

<style></style>
